<?php 
session_start();
 ?>
 <!doctype html>
 <html lang="en">
 <head>
 	<meta charset="UTF-8">
 	<title>read_mcrypt</title>
 </head>
 <body>
 	<?php 
 	//判断session 值是否存在
 	if(isset($_SESSION['li'],$_SESSION['jian']))
 	{
 		//创建密钥，这里的密钥要和加密密钥相同
 		$key=md5('what are you doing');
 		//打开加密算子
 		$m=mcrypt_module_open('rijndael-256', '', 'cbc', '');
 		//对初始化向量进行解码,返回二进制数据
 		$vi=base64_decode($_SESSION['jian']);
 		//初始化解密过程
 		mcrypt_generic_init($m, $key, $vi);
 		//解密数据
 		$data=mdecrypt_generic($m, base64_decode($_SESSION['li']));
 		//关闭缓存和模块
 		mcrypt_generic_deinit($m);
 		mcrypt_module_close($m);
 		echo " the session has been read .Its value is :". trim($data);

 	}
 	 ?>
 	
 </body>
 </html>